import { observer } from "mobx-react";

function App({ counterStore }) {
  // console.log(counterStore);

  const increment = () => {
    // counterStore.increment();
    counterStore.count++;
  };

  // const decrement = () => {
  //   counterStore.decrement();
  // };

  return (
    <>
      <p>
        count: {counterStore.count}，count is {counterStore.oddOrEven}
      </p>
      <button onClick={increment}>+</button>
      <button onClick={() => counterStore.decrement()}>-</button>
    </>
  );
}

// observer高阶组件：HOC
export default observer(App);
